﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UserControl/MasterPage.Master"
    AutoEventWireup="true" CodeBehind="DangKy.aspx.cs" Inherits="TMDT_Nhom1A.DangKy" %>

<%@ Register Src="UserControl/GioHang.ascx" TagName="GioHang" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script src="js/AjaxRequest.js" type="text/javascript"></script>

    <script src="js/jquery.pstrength-min.1.2.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(function() {
            $('.password').pstrength();
        });
    </script>

    <div id="divRegistry" runat="server" class="module_round_box_inner">
        <div class="module_round_box_inner2">
            <div class="s5_mod_h3_1">
                <div class="s5_mod_h3_2">
                    <h3 class="s5_mod_h3">
                        <span class="s5_h3_first">Đăng ký</span>
                    </h3>
                </div>
            </div>
            <div runat="server" style="padding-top: 30px; padding-bottom: 30px">
                <asp:ScriptManager ID="ScriptManager2" runat="server" EnablePageMethods="true">
                </asp:ScriptManager>
                <div class="label_register">
                    <asp:Label ID="Label26" runat="server" Text="Label"> Tên công ty :</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="tbnamecompany" Width="200px" CssClass="tb_2" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator15" runat="server" ControlToValidate="tbnamecompany"
                        ErrorMessage="*"></asp:RequiredFieldValidator>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label23" runat="server" Text="Label"> Địa chỉ công ty (không có tên thành phố):</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="tbaddresscompany" Width="200px" CssClass="tb_2" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="tbaddresscompany"
                        ErrorMessage="*"></asp:RequiredFieldValidator>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label5" runat="server" Text="Label"> Chọn Thành Phố :</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:DropDownList ID="drlCity" Width="208px" CssClass="tb_2" runat="server">
                    </asp:DropDownList>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label18" runat="server" Text="Label"> Mã số thuế :</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="tbnumebertax" Width="200px" CssClass="tb_2" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="tbnumebertax"
                        ErrorMessage="*"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ControlToValidate="tbnumebertax"
                        ErrorMessage="Vui lòng nhập số" ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label1" runat="server" Text="Label" AssociatedControlID="txtUsername"> UserName :</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="txtUsername" CssClass="tb_2" Width="200px" runat="server" onkeyup="usernameChecker(this.value);"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtUsername"
                        ErrorMessage="*"></asp:RequiredFieldValidator>
                    <span id="spanAvailability"></span>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label2" runat="server" Text="Label"> Password:</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="txtPassword" CssClass="password" Width="200px" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPassword"
                        ErrorMessage="*"></asp:RequiredFieldValidator>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label13" runat="server" Text="Label"> xác nhận lại Password:</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="txtXacNhanPassword" CssClass="tb_2" Width="200px" runat="server"
                        TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtXacNhanPassword"
                        ErrorMessage="*"></asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtPassword"
                        ControlToValidate="txtXacNhanPassword" ErrorMessage="xác nhận mật khẩu không đúng"></asp:CompareValidator>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label3" runat="server" Text="Label"> Họ:</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="txtHo" Width="200px" CssClass="tb_2" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtHo"
                        ErrorMessage="*"></asp:RequiredFieldValidator>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label4" runat="server" Text="Label"> Tên:</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="txtTen" Width="200px" CssClass="tb_2" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtTen"
                        ErrorMessage="*"></asp:RequiredFieldValidator>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label7" runat="server" Text="Label"> Email:</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="txtEmail" Width="200px" CssClass="tb_2" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtEmail"
                        ErrorMessage="*"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEmail"
                        ErrorMessage="Emai không hợp lệ" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label9" runat="server" Text="Label"> Điện Thoại :</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="txtdienthoai" Width="200px" CssClass="tb_2" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtdienthoai"
                        ErrorMessage="Vui lòng nhập số" ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label10" runat="server" Text="Label">Di động :</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="txtdidong" Width="200px" CssClass="tb_2" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtdidong"
                        ErrorMessage="Vui lòng nhập số" ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label11" runat="server" Text="Label">Vai trò :</asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:TextBox ID="tbrole" Width="200px" CssClass="tb_2" runat="server"></asp:TextBox>
                </div>
                <div class="label_register">
                    <asp:Label ID="Label6" runat="server" Text="Label"> Nhập mã xác nhận:</asp:Label>
                </div>
                <div class="textbox_register">
                    <img id="imgValidCode" src="captcha.aspx" alt="capcha" />
                    <img id="imbReLoad" src="images/RefeshCapcha.png" width="32px" height="32px" onclick="ChangeImage()"
                        alt="refesh" style="cursor: pointer" /><br />
                    <asp:TextBox runat="Server" ID="txtCaptcha" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtCaptcha"
                        ErrorMessage="*"></asp:RequiredFieldValidator>
                    <br />
                    <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
                </div>
                <div class="textbox_register">
                    <asp:Button ID="btregistry" runat="server" Text="Đăng Ký" CssClass="button" OnClick="btregistry_Click"
                        Style="cursor: pointer" />
                </div>

                <script type="text/javascript">
                    var usernameCheckerTimer;
                    var spanAvailability = $get("spanAvailability");

                    function usernameChecker(username) {
                        clearTimeout(usernameCheckerTimer);
                        if (username.length == 0)
                            spanAvailability.innerHTML = "";
                        else {
                            spanAvailability.innerHTML = "<span style='color: #ccc;'>checking...</span>";
                            usernameCheckerTimer = setTimeout("checkUsernameUsage('" + username + "');", 750);
                        }
                    }

                    function checkUsernameUsage(username) {
                        // initiate the ajax pagemethod call
                        // upon completion, the OnSucceded callback will be executed
                        PageMethods.IsUserAvailable(username, OnSucceeded);
                    }

                    // Callback function invoked on successful completion of the page method.
                    function OnSucceeded(result, userContext, methodName) {
                        if (methodName == "IsUserAvailable") {
                            if (result == true)
                                spanAvailability.innerHTML = "<span style='color: DarkGreen;'>Available</span>";
                            else
                                spanAvailability.innerHTML = "<span style='color: Red;'>Unavailable</span>";
                        }
                    }
                </script>

            </div>
        </div>
    </div>
    <div id="divInformation" runat="server" visible="false" class="module_round_box_inner">
        <div class="module_round_box_inner2">
            <div class="s5_mod_h3_1">
                <div class="s5_mod_h3_2">
                    <h3 class="s5_mod_h3">
                        <span class="s5_h3_first">Thông báo</span>
                    </h3>
                </div>
            </div>
            <div style="padding-top: 30px; padding-bottom: 30px; text-align: center">
                <asp:Label ID="lbThongbao" runat="server" Text="" Font-Size="16"> </asp:Label>
                <br />
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="Default.aspx"> Về trang chủ</asp:HyperLink>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="ContentPlaceHolder2">
    <uc1:GioHang ID="GioHang1" runat="server" />
</asp:Content>
